<script lang="ts">
  import "./app.css";
  import Layout from "@/layout/Layout.svelte";
  import Router from "@/router/Router.svelte";
  import { locale } from "svelte-i18n";
  import Toast from "./components/Toast.svelte";
  import { toast } from "@/utils/toastService";
</script>

{#if $locale}
  <Layout>
    <Router />
  </Layout>
  {#if $toast.visible}
    <!-- 使用$来访问store的值 -->
    <Toast message={$toast.message} />
    <!-- 将消息传递给Toast组件 -->
  {/if}
{/if}

<style lang="less">
  #app {
    padding: 0;
    margin: 0;
  }
</style>
